#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int map[40][40] = { 0 };
int main()
{
	int n, i = 1;
	scanf("%d", &n);
	int j = n / 2 + 1, ret = 0;
	map[i][j] = 1;
	for (ret = 2; ret <= n*n; ret++) {
		if (i == 1 && j != n) { map[n][j + 1] = ret; i = n; j++; }
		else if (j == n && i != 1) { map[i - 1][1] = ret; i--; j = 1; }
		else if (i == 1 && j == n) { map[i + 1][j] = ret; i++; }
		else if (i != 1 && j != n) {
			if (map[i - 1][j + 1] == 0) { map[i - 1][j + 1] = ret; i--; j++; }
			else { map[i + 1][j] = ret; i++; }
		}
	}
	for (int a = 1; a <= n; a++) {
		for (int b = 1; b <= n; b++) {
			printf("%d ", map[a][b]);
		}
		printf("\n");
	}
	return 0;
}